var WebpackIconfontPluginNodejs = require('webpack-iconfont-plugin-nodejs');
var config = require('./config.js');

console.log('config.name', config.name);

var path = require('path');
var dir = process.cwd();

console.log('process.cwd():', process.cwd());

var options = {
	fontName: `${config.name}`,
	// fontName: 'my-icon',
	cssPrefix: `${config.name}`,
	svgs: path.join(dir, 'packages/assets/svgIcon/*.svg'),
	template: path.join(__dirname, 'scss.njk'),
	// htmlTemplate: path.join(dir, 'html.njk'),
	fontsOutput: path.join(dir, 'packages/assets/iconfont/'),
	cssOutput: path.join(dir, 'packages/assets/iconfont/font.scss'),
	htmlOutput: path.join(dir, 'tmp/_font-preview.html'),
	// jsOutput: path.join(dir, 'packages/assets/fonts/fonts.js'),
	formats: ['woff2', 'woff']
};

new WebpackIconfontPluginNodejs(options).build();
